//
//  NotificationView.m
//  Comma
//
//  Created by dlios on 15-1-14.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "NotificationView.h"
#import "Masonry.h"
#import "NotificationTableViewCell.h"
#import "MyButtonView.h"
#import "GlobalMacro.h"
#import "GlobalMethod.h"
#import "EnvelopeView.h"
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
@implementation NotificationView

#pragma mark - 创建一个tableview

//- (void)createView
//{

//    self.clickLeft = YES;
//    self.clickRight = NO;
//    self.envelopeView = [[EnvelopeView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH, 108, SCREEN_WIDTH, (SCREEN_HEIGHT - 108))];
//    [self addSubview:self.envelopeView];
    
//}
- (void)createTableView
{
    self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
    //    self.tableView.delegate = self;
    [self addSubview:self.tableView];
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(@(108));
        make.width.mas_equalTo(@(SCREEN_WIDTH));
        make.height.mas_equalTo(@(SCREEN_HEIGHT - 108));
    }];
}
- (void)createViewHeaderView
{
//    //添加两个button 分别是通知 和站内信
    self.myHeaderView = [[MyButtonView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 108)];
    [self.myHeaderView createView];
    [self.myHeaderView createButton];
//    if (self.clickLeft == YES && self.clickRight == NO) {
        self.tableView.frame = CGRectMake(0, 108, SCREEN_WIDTH, SCREEN_HEIGHT - 108);
        self.myHeaderView.leftLable.textColor = TEXTGREENCOLOR;
        self.promptLable.frame = CGRectMake(30, 138, SCREEN_WIDTH - 60, SCREEN_WIDTH - 60);
//        self.myHeaderView.rightLable.textColor = TEXTERGRAY;
        [self addSubview:self.myHeaderView];
//        self.envelopeView.frame = CGRectMake(SCREEN_WIDTH, 108, SCREEN_WIDTH, (SCREEN_HEIGHT - 108));
//        [self addSubview:self.envelopeView];
//        
//    }
//    else
//    {
//        self.tableView.frame = CGRectMake(SCREEN_WIDTH, 108, SCREEN_WIDTH, SCREEN_HEIGHT - 108);
//        self.promptLable.frame = CGRectMake(SCREEN_WIDTH + 30, 138, SCREEN_WIDTH - 60, SCREEN_WIDTH - 60);
//        self.myHeaderView.rightLable.textColor = TEXTGREENCOLOR;
//        self.myHeaderView.leftLable.textColor = TEXTERGRAY;
//        [self addSubview:self.myHeaderView];
//        self.envelopeView.frame = CGRectMake(0, 108, SCREEN_WIDTH, (SCREEN_HEIGHT - 108));
//        [self addSubview:self.envelopeView];
//        
//    }
//    
//    [self.myHeaderView.rightButton addTarget:self action:@selector(rightAction:) forControlEvents:UIControlEventTouchUpInside];
//    [self.myHeaderView.leftButton addTarget:self action:@selector(leftAction:) forControlEvents:UIControlEventTouchUpInside];
//    
//    
}
//
//- (void)leftAction:(id)sender
//{
//    self.tableView.frame = CGRectMake(0, 108, SCREEN_WIDTH, SCREEN_HEIGHT - 108);
//    self.promptLable.frame = CGRectMake(30, 138, SCREEN_WIDTH - 60, SCREEN_WIDTH - 60);
//    self.myHeaderView.leftLable.textColor = TEXTGREENCOLOR;
//    self.myHeaderView.rightLable.textColor = TEXTERGRAY;
//    self.myHeaderView.twigView.frame = CGRectMake(SCREEN_WIDTH / 2  - self.myHeaderView.leftLable.frame.size.width - 10, self.myHeaderView.frame.size.height - 2, self.myHeaderView.leftLable.frame.size.width, 2);
//    self.envelopeView.frame = CGRectMake(SCREEN_WIDTH, 108, SCREEN_WIDTH, (SCREEN_HEIGHT - 108));
//    
//    
//}
//- (void)rightAction:(id)sender
//{
//    self.tableView.frame = CGRectMake(SCREEN_WIDTH, 108, SCREEN_WIDTH, SCREEN_HEIGHT - 108);
//    self.promptLable.frame = CGRectMake(SCREEN_WIDTH + 30, 138, SCREEN_WIDTH - 60, SCREEN_WIDTH - 60);
//    self.myHeaderView.leftLable.textColor = TEXTERGRAY;
//    self.myHeaderView.rightLable.textColor = TEXTGREENCOLOR;
//    self.myHeaderView.twigView.frame = CGRectMake(SCREEN_WIDTH / 2, self.myHeaderView.frame.size.height - 2, self.myHeaderView.rightLable.frame.size.width, 2);
//    self.envelopeView.frame = CGRectMake(0, 108, SCREEN_WIDTH, (SCREEN_HEIGHT - 108));
//}
- (void)createNoData
{
    self.promptLable = [[UILabel alloc] initWithFrame:CGRectMake(30, 138, SCREEN_WIDTH - 60, SCREEN_WIDTH - 60)];
    self.promptLable.textAlignment = NSTextAlignmentCenter;
    self.promptLable.numberOfLines = 0;
    self.promptLable.textColor = TEXTGREENCOLOR;
    self.promptLable.font = [UIFont systemFontOfSize:17.0f];
    self.promptLable.text = @"您还没有新的通知,努力发帖才会有更多的通知哦\n                    ------豆号";
    [self addSubview:self.promptLable];
    
}
/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */

@end
